#pragma once
#ifndef RESOURCE_MANAGER_H
#define RESOURCE_MANAGER_H

#include <vector>
#include <string>
#include <map>
#include <boost/scoped_ptr.hpp>
#include <boost/shared_ptr.hpp>
#include <SFML/Graphics.hpp>
#include "AnimatedSprite.h"
#include "MapLoader.h"

class ResourceManager
{
public:

	static ResourceManager* getInstance();

	sf::Font* loadFont(const std::string& fontName);

	sf::Image* loadImage(const std::string& imageName);

	std::vector<AnimationDefinition> loadAnimationFromXML(const std::string& file);

	MapInfo loadMapInfo(const std::string& mapName);

protected:
	
	ResourceManager();

private:

	static boost::scoped_ptr<ResourceManager> singleton;

	MapLoader mapLoader;

	std::map<std::string, boost::shared_ptr<sf::Image>> images;

	std::map<std::string, boost::shared_ptr<sf::Font>> fonts;
};

#endif //RESOURCE_MANAGER_H
